﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PFB_TextFile_Read_Write
{
    class Person
    {
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public DateTime DateOfBirth { get; set; }
        public static Person FromString(string info)
        {
            Person person = new Person();

            string[] personText = info.Split('\t');
            person.FirstName = personText[0];
            person.LastName = personText[1];
            person.DateOfBirth = DateTime.Parse(personText[2]);

            return person;
        }
        public override string ToString()
        {
            return String.Format("{0}\t{1}\t{2}", FirstName, LastName, DateOfBirth.ToLongDateString());
        }
    }
}
